/**
 * @author xhw
 */

public class test02 {
    public static void main(String[] args) {
        Thread thread1 = new Thread(() -> {
            System.out.println("正常线程");
        });
//        Thread thread2 = new Thread(() -> {
//            //将一个字符串转换为Integer
//            Integer.parseInt("尝试将String转为Integer");
//            System.out.println("错误线程");
//        });
        Thread thread3 = new Thread(() -> {
            try {
                throw new RuntimeException("线程错误");
            } catch (Exception e) {
                System.out.println("错误被处理");
            }
        });
        thread1.start();
//        thread2.start();
        thread3.start();

    }
}
//多线程，只有异常不被处理的线程会导致进程停止